<!DOCTYPE html>
<html lang='zh-CN'>
<meta charset='utf-8'>
<body>
<p>登录中...</p>
</body>
</html>
<script type="text/javascript">

    var error = getQueryVariable("error");
    if ("true" === error) {
        var message = getQueryVariable("message") || "未知错误";

        window.location.href = "/#/user/login?message="+message;
    }

    var token = getQueryVariable("token");
    if (token) {
        localStorage.setItem("X-Access-Token", token);
        var direct = getQueryVariable("redirect");
        if (direct) {
            window.location.href = decodeURIComponent(direct);
        } else {
            window.location.href = "/";
        }
    }

    function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] === variable) {
                return pair[1];
            }
        }
        return false;
    }
</script>